#include<bits/stdc++.h>
using namespace std;
int n,r[100001],a[100001],pos=0,ans=0,idx=1;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&r[i]);
	}
	sort(r+1,r+n+1);
	for(int i=1;i<=n;i++)
	{
		if(r[i]!=r[i-1])
		{
			pos++;
		}
		a[pos]++;
	}
	for(int i=2;i<=pos;i++)
	{
		if(a[i]>=a[idx])
		{
			while(a[i]>=a[idx]&&i!=idx)
			{
				a[idx]=0;
				idx++;
			}
		}
		else
		{
			a[idx]-=a[i];
		}
	}
	for(int i=1;i<=pos;i++)
	{
		ans+=a[i];
	}
	printf("%d",ans);
	return 0;
}
